/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.socket.client;

/**
 *
 * @author CongChinh
 */
import javax.swing.table.AbstractTableModel;
import java.util.Vector;
public class MotorTableModel extends AbstractTableModel {
    
    private static final String[] columns = {"xeID", "xeName", "xeColor", "xePrice", "xeMark", "xeQuantity"};
    private Vector rows = new Vector();
    public void setMotorsModel(Vector rows) {
        this.rows = rows;
        fireTableDataChanged();
    }
    public Object getValueAt(int r, int c) {
        return ((Vector)rows.elementAt(r)).elementAt(c);
    }
    public int getColumnCount() {
        return columns.length;
    }
    public int getRowCount() {
        return rows.size() > 0 ? rows.size() : 0;
    }
    @Override
    public String getColumnName(int c) {
        return columns[c];
    }
}
